#include <iostream>

class Student 
{
    public:
    //声明构造函数
    Student (const char * name, int age)
    {
        m_name = name;
        m_age = age;
    }
    //声明普通成员函数
    void show()
    {
        std::cout<<m_name<<"的年龄是"<<m_age<<std::endl;
    }
    private:
    const char * m_name;
    int m_age;
};

int main()
{
    //创建对象时向构造函数传参
    Student stu("xiaoming", 15);
    stu.show();
    return 0;
}